var Login = {
		
	showLogin:function(el) {
		var bubble = $('#main').data('bubble');
		bubble.setBody('<div id="email"><p class="textbox">'+
	    '<label for="username">Email</label>'+
	    '<input type="text" class="esoinput" name="email" value="" title="username" tabindex="4">'+
	    '</p><div class="errorText">&nbsp;</div></div><div id="password"><p class="textbox">'+
	    '<label for="password">Password</label>'+
	    '<input type="password" class="esoinput" name="password" value="" title="password" tabindex="5">'+
	    '</p><div class="errorText">&nbsp;</div></div>'+
	    '<p class="remember">'+
	    '<button type="submit" onclick="doPostWithInputs(\'user.SubmitLogin\',\'#bubble input\')" class="esobutton" style="padding:2px 15px;" id="signinbutton" tabindex="7">Sign In</button>'+
	    '<input type="checkbox" id="remember" name="remember_me" value="1" tabindex="6">'+
	    '<label for="remember">Remember me</label>'+
	    '<div><a onclick="createAcct()">Sign Up</a></div>'+
		'</p>');
		bubble.setAutoClose(false);
	},
	setLoggedInHeader:function(user) {
		$('.toolbar ul li.notloggedin').fadeOut(function(){
		var showElem = $(this).next(); 
		if(user.usertype=='REALTOR') showElem = showElem.next(); 
		
		showElem.fadeIn().find('#settings').html(user.firstname+' '+user.lastname);});
		$.cookie("user", user.email, { expires:7,path: '/' });
	},
	removeLoggedInHeader:function() {
		var notLoggedInElem = $('.toolbar ul li.notloggedin');
		$('.usersettings').fadeOut(function(){notLoggedInElem.fadeIn();}).find('#settings').html('');
	},
	check:function(data) {
		if(!data || data.notloggedin)
		{
			this.removeLoggedInHeader();
			$.address.value('/home');
			return false;
		}
		return true;
	}
};